var Xiangmu = new Vue({

    el : '#Xiangmulist',
    data:{
        xiangmutext:'',
        xiangmu : {},
        xiangmulist : [],
        xiangmuleixinglist : [],

        excelxiangmulist:[],//批量导入

        xiangmuId:'',
        editFlag : 0,					// 0:新增，1：修改
        show : false,					// 显示列表是否有数据

        pageIndex : 1,
        pageSize : 10,
        pageCount : 0,
        recordCount : 0,
        inputPageIndexValue : "",
    },
    created : function() {
        var _this = this;
        $(".nav navbar-nav li").removeClass("active");
        $("#nav_xiangmu").addClass("active");
        let pagenum = Number(window.sessionStorage.getItem('currentPageNum')) || 1;
        this.pageIndex = pagenum; 
        _this.bindXiangmuList();
        _this.bindXiangmuleixingList();

    },
    methods : {
        toAddRoundSecond : function(xiangmuid,xiangmuleixing){
            var _this = this;
            $.post('/TyController/toAddRoundSecond',{
                xiangmuid:xiangmuid,
                xiangmuleixing:xiangmuleixing,
                rdm:Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if(ppData!=null){
                    if(ppData.result == '1'){
                        layer.open({
                            time:1000,
                            btn:[],
                            content:"添加二轮投票成功!",
                        });
                        _this.bindXiangmuList();
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },
        gethysj : function(){
            this.xiangmu.meetingtime = $("#hysj").val();
        },

        bindXiangmuleixingList:function (){
            var _this = this;
            layer.open({type:3});
            $.post('/xiangmuleixing/find_all',{
                text:"",
                rdm:Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if(ppData!=null){
                    if(ppData.result == '1'){
                        _this.xiangmuleixinglist =ppData.resultContent;

                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },

        bindXiangmuList:function (){
            var _this = this;
            layer.open({type:3});
            $.post("/xiangmu/findAllBypage",{
                xiangmuname :_this.xiangmutext,
                pageindex : _this.pageIndex,
                pagesize : _this.pageSize,
                rdm : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if (ppData != null){
                    if(ppData.result == "1"){
                        var data=ppData.resultContent;


                        if(data.XiangMuList.length > 0){
                            _this.show = true;
                            _this.xiangmulist=data.XiangMuList;

                            var PageInfo = data.PageInfo;
                            _this.pageIndex = PageInfo.pageIndex;
                            _this.recordCount = PageInfo.recordCount;
                            _this.pageCount = PageInfo.pageCount;

                        }else {
                            _this.show = false;
                        }

                    }else{
                        layer.alert(ppData.message);
                    }
                }

            },"json");
        },

        toAdd : function (){
            $('#editXiamguModal').modal();
            $("#myModalLabel_xiamgu").html("新增表决项目");
            this.editFlag = 0;
            this.xiangmu = {};

        },

        addXiangmu:function (){
            var _this = this;
            if(_this.checkInputData()){
                layer.open({type:3});
                $.post('/xiangmu/add',{
                    xiangmuname:$.trim(_this.xiangmu.xiangmuname),
                    xiangmuleixing:$.trim(_this.xiangmu.xiangmuleixing),
                  /*  meetingtime:$.trim(_this.xiangmu.meetingtime),*/
                    zhuangjiashu:$.trim(_this.xiangmu.zhuangjiashu),
                    tongguoshu:$.trim(_this.xiangmu.tongguoshu),
                    random : Math.random()
                },function(ppData){
                    if(ppData != null){
                        layer.closeAll("loading");

                        if(ppData.result == "1"){
                            layer.open({
                                time:1000,
                                btn:[],
                                content:"新增成功!",
                            });
                            $("#editXiamguModal").modal("hide");
                            _this.bindXiangmuList();
                        }else{
                            layer.alert(ppData.message);
                        }
                    }
                },"json");

            }
        },

        toModify:function (ppxiangmuid){
            $('#editXiamguModal').modal();
            $("#myModalLabel_xiamgu").html("修改");
            this.editFlag = 1;
            this.xiangmu = {};
            this.xiangmuId=ppxiangmuid;

            this.bindXiangmu();
        },

        bindXiangmu:function (){
            var _this = this;
            layer.open({type:3});
            $.post('/xiangmu/find_one', {
                xianmguid : _this.xiangmuId,
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                        var data = ppData.resultContent;
                        _this.xiangmu = data;
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },

        modifyXiangmu:function (){
            var _this = this;
            if(_this.checkInputData()){
                layer.open({type:3});

                $.post('/xiangmu/modify',{
                    xianmguid : _this.xiangmuId,
                    xiangmuname:$.trim(_this.xiangmu.xiangmuname),
                    xiangmuleixing:$.trim(_this.xiangmu.xiangmuleixing),
                 /*   meetingtime:$.trim(_this.xiangmu.meetingtime),*/
                    zhuangjiashu:$.trim(_this.xiangmu.zhuangjiashu),
                    tongguoshu:$.trim(_this.xiangmu.tongguoshu),
                    random : Math.random()
                },function(ppData){
                    if(ppData != null){
                        layer.closeAll("loading");

                        if(ppData.result == "1"){
                            layer.open({
                                time:1000,
                                btn:[],
                                content:"修改成功!",
                            });
                            $("#editXiamguModal").modal("hide");
                            _this.bindXiangmuList();
                        }else{
                            layer.alert(ppData.message);
                        }
                    }
                },"json");

            }
        },

        toDelete:function (ppxiangmuid){
            var _this = this;

            layer.confirm("确定删除该条项目信息吗？",{
                btn : ['是','否']
            },function(){
                layer.open({type:3});

                $.post("/TyController/deleteXiangmu", {
                    xianmguid : ppxiangmuid,
                    random : Math.random()
                }, function(ppData) {
                    if (ppData != null) {
                        layer.closeAll("loading");

                        if(ppData.result != "1"){
                            layer.alert(ppData.message);
                        }else{
                            layer.open({
                                time:1000,
                                btn:[],
                                content:"删除成功!",
                            });

                            _this.bindXiangmuList();
                        }
                    }
                },"json");
            })
        },

        toModifyIsactived : function(ppxiangmuid,ppisactive){

            var _this = this;
            layer.open({type:3});
            $.post("/xiangmu/modifyisactived", {
                xiangmuid : ppxiangmuid,
                isactive : ppisactive,
                random : Math.random()
            }, function(ppData) {
                if (ppData != null) {
                    layer.closeAll("loading");

                    if(ppData.result != "1"){
                        layer.alert(ppData.message);
                    }else{
                        layer.open({
                            time:1000,
                            btn:[],
                            content:"设置成功!",
                        });
                        _this.bindXiangmuList();
                    }
                }
            },"json");


        },

        toShowJindu : function(ppxiangmuid,ppxiangmuleixing){

            location.href="jindu?xiangmuid="+ppxiangmuid+"&xiangmuleixing="+ppxiangmuleixing;

        },

        toShowXiangmuDetailList  : function(ppxiangmuid,ppxiangmuleixing){
            this.xiangmuid=ppxiangmuid;
            location.href="/TyController/ViewAll?xiangmuid="+this.xiangmuid+"&xiangmuleixing="+ppxiangmuleixing;

            /*if(ppxiangmuleixing=="1"){
                location.href="kangjun?xiangmuid="+this.xiangmuid;
            }
            if(ppxiangmuleixing=="2"){
                location.href="tongkeyaopin?xiangmuid="+this.xiangmuid;
            }
            if(ppxiangmuleixing=="3"){
                location.href="zhuankeyaopin?xiangmuid="+this.xiangmuid;
            }
            if(ppxiangmuleixing=="4"){
                location.href="xinguotan?xiangmuid="+this.xiangmuid;
            }
            if(ppxiangmuleixing=="5"){
                location.href="chuangxinchanpin?xiangmuid="+this.xiangmuid;
            }
            if(ppxiangmuleixing=="6"){
                location.href="xinyaoshenqing?xiangmuid="+this.xiangmuid;
            }
            if(ppxiangmuleixing=="7"){
                location.href="yuecaikangjun?xiangmuid="+this.xiangmuid;
            }
            if(ppxiangmuleixing=="8"){
                location.href="shengchanqiyelinxuan?xiangmuid="+this.xiangmuid;
            }*/

            //location.href="shengchanqiyelinxuan?xiangmuid="+this.xiangmuid;


        },

        toPrintlList:function (ppxiangmuid,ppxiangmuleixing){

          /*  if(ppxiangmuleixing=="1"){
                location.href="printKangjunyaowu?xiangmuid="+ppxiangmuid+"&xiangmuleixing="+ppxiangmuleixing;
            }
            if(ppxiangmuleixing=="2"){
                location.href="printTongkeyaopin?xiangmuid="+ppxiangmuid+"&xiangmuleixing="+ppxiangmuleixing;
            }
            if(ppxiangmuleixing=="3"){
                location.href="printZhuankeyaopin?xiangmuid="+ppxiangmuid+"&xiangmuleixing="+ppxiangmuleixing;
            }
            if(ppxiangmuleixing=="4"){
                location.href="printXinguotan?xiangmuid="+ppxiangmuid+"&xiangmuleixing="+ppxiangmuleixing;
            }
            if(ppxiangmuleixing=="5"){
                location.href="printChuangxinchanpin?xiangmuid="+ppxiangmuid+"&xiangmuleixing="+ppxiangmuleixing;
            }
            if(ppxiangmuleixing=="6"){
                location.href="printXinyaoshenqing?xiangmuid="+ppxiangmuid+"&xiangmuleixing="+ppxiangmuleixing;
            }
            if(ppxiangmuleixing=="7"){
                location.href="printYuecaiyaowu?xiangmuid="+ppxiangmuid+"&xiangmuleixing="+ppxiangmuleixing;
            }*/
            /*if(ppxiangmuleixing=="8"){
                location.href="shengchanqiye/huizongbiao?xiangmuid="+ppxiangmuid+"&xiangmuleixing="+ppxiangmuleixing;
            }*/
            location.href="printTy?xiangmuid="+ppxiangmuid+"&xiangmuleixing="+ppxiangmuleixing;

        },

        toshowUploadXls : function(ppxiangmuid,ppxiangmuleixing){
            this.xiangmuId=ppxiangmuid;
            $("#uploadModal").modal("show");
            this.getFileUrl("ylsbtp",'2000','xls,xlsx',ppxiangmuleixing);
        },

        getFileUrl : function(ppFolderName,ppFileSize,ppShangChuanWenJianLeiXing,ppxiangmuleixing){
            var _this = this;
            $("#uploadModal-body").load("upload_batch.html?fujianpath=/ylsbtp/"+ppFolderName+"&filesize="+ppFileSize, function(){
                UploadVue.Init(ppShangChuanWenJianLeiXing,ppFileSize+"kb",function(jsonList){
                    if(jsonList.length==0){
                        return;
                    }
                    var filename=jsonList[0].filename;
                    var fileurl=jsonList[0].fileurl;
                    var filesize=jsonList[0].filesize;
                    _this.getFujianValue(fileurl,ppxiangmuleixing);

                   /* if(ppxiangmuleixing=="1"){
                        _this.getKangjunValue(fileurl,ppxiangmuleixing);
                    }
                    if(ppxiangmuleixing=="2"){
                        _this.getTongkeyaopinValue(fileurl,ppxiangmuleixing);
                    }
                    if(ppxiangmuleixing=="3"){
                        _this.getZhuankeyaopinValue(fileurl,ppxiangmuleixing);
                    }
                    if(ppxiangmuleixing=="4"){
                        _this.getxinguotanValue(fileurl,ppxiangmuleixing);
                    }
                    if(ppxiangmuleixing=="5"){
                        _this.getchuangxinchanpinValue(fileurl,ppxiangmuleixing);
                    }
                    if(ppxiangmuleixing=="6"){
                        _this.getXinyaoValue(fileurl,ppxiangmuleixing);
                    }
                    if(ppxiangmuleixing=="7"){
                        _this.getyuecaiKangjunValue(fileurl,ppxiangmuleixing);
                    }
                    if(ppxiangmuleixing=="8"){
                        _this.getShengchanqiyeValue(fileurl,ppxiangmuleixing);
                    }*/

                    //_this.getShengchanqiyeValue(fileurl,ppxiangmuleixing);

                },function(){
                    $("#uploadModal").modal("hide");
                });
            });
        },
        getShengchanqiyeValue : function(ppFileurl,ppxiangmuleixing){
            var _this=this;
            _this.excelxiangmulist=[];
            layer.open({type:3});
            $.post("/import_xiangmu/get_shengchanqiye",{
                xianmguid : _this.xiangmuId,
                fileurl:ppFileurl,
                random : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if(ppData != null){
                    var mmData = ppData;
                    var result = mmData.result;
                    var message = mmData.message;
                    var data = mmData.resultContent;
                    if(result == "1") {
                        _this.excelxiangmulist = ppData.resultContent;
                        _this.importXiangmu(ppxiangmuleixing);

                    }else{
                        layer.alert(message);
                    }
                }
            },"json");

        },

        getKangjunValue : function(ppFileurl,ppxiangmuleixing){
            var _this=this;
            _this.excelxiangmulist=[];
            layer.open({type:3});
            $.post("/import_xiangmu/get_kangjunyaowu",{
                xianmguid : _this.xiangmuId,
                fileurl:ppFileurl,
                random : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if(ppData != null){
                    var mmData = ppData;
                    var result = mmData.result;
                    var message = mmData.message;
                    var data = mmData.resultContent;
                    if(result == "1") {
                        _this.excelxiangmulist = ppData.resultContent;
                        _this.importXiangmu(ppxiangmuleixing);

                    }else{
                        layer.alert(message);
                    }
                }
            },"json");

        },
        getFujianValue : function(ppFileurl,ppxiangmuleixing){
            var _this=this;
            _this.excelxiangmulist=[];
            layer.open({type:3});
            $.post("/TyController/importExel",{
                xianmguid : _this.xiangmuId,
                xiangmuleixing : ppxiangmuleixing,
                fileurl:ppFileurl,
                random : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if(ppData != null){
                    var mmData = ppData;
                    var result = mmData.result;
                    var message = mmData.message;
                    var data = mmData.resultContent;
                    if(result == "1") {
                        //_this.excelxiangmulist = ppData.resultContent;
                        //_this.importXiangmu(ppxiangmuleixing);
                        layer.alert("导入完成！");
                        $("#uploadModal").modal("hide");
                    }else{
                        layer.alert(message);
                    }
                }
            },"json");

        },

        getXinyaoValue : function(ppFileurl,ppxiangmuleixing){
            var _this=this;
            _this.excelxiangmulist=[];
            layer.open({type:3});
            $.post("/import_xiangmu/get_xinyaoshenqing",{
                xiangmuid : _this.xiangmuId,
                fileurl:ppFileurl,
                random : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if(ppData != null){
                    var mmData = ppData;
                    var result = mmData.result;
                    var message = mmData.message;
                    var data = mmData.resultContent;
                    if(result == "1") {
                        _this.excelxiangmulist = ppData.resultContent;
                        _this.importXiangmu(ppxiangmuleixing);

                    }else{
                        layer.alert(message);
                    }
                }
            },"json");

        },

        getTongkeyaopinValue : function(ppFileurl,ppxiangmuleixing){
            var _this=this;
            _this.excelxiangmulist=[];
            layer.open({type:3});
            $.post("/import_xiangmu/get_tongkeyaopin",{
                xianmguid : _this.xiangmuId,
                fileurl:ppFileurl,
                random : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if(ppData != null){
                    var mmData = ppData;
                    var result = mmData.result;
                    var message = mmData.message;
                    var data = mmData.resultContent;
                    if(result == "1") {
                        _this.excelxiangmulist = ppData.resultContent;
                        _this.importXiangmu(ppxiangmuleixing);

                    }else{
                        layer.alert(message);
                    }
                }
            },"json");

        },
        getZhuankeyaopinValue : function(ppFileurl,ppxiangmuleixing){
            var _this=this;
            _this.excelxiangmulist=[];
            layer.open({type:3});
            $.post("/import_xiangmu/get_zhuankeyaopin",{
                xianmguid : _this.xiangmuId,
                fileurl:ppFileurl,
                random : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if(ppData != null){
                    var mmData = ppData;
                    var result = mmData.result;
                    var message = mmData.message;
                    var data = mmData.resultContent;
                    if(result == "1") {
                        _this.excelxiangmulist = ppData.resultContent;
                        _this.importXiangmu(ppxiangmuleixing);

                    }else{
                        layer.alert(message);
                    }
                }
            },"json");

        },
        getyuecaiKangjunValue : function(ppFileurl,ppxiangmuleixing){
            var _this=this;
            _this.excelxiangmulist=[];
            layer.open({type:3});
            $.post("/import_xiangmu/get_yuecaikangjunyaowu",{
                xiangmuid : _this.xiangmuId,
                fileurl:ppFileurl,
                random : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if(ppData != null){
                    var mmData = ppData;
                    var result = mmData.result;
                    var message = mmData.message;
                    var data = mmData.resultContent;
                    if(result == "1") {
                        _this.excelxiangmulist = ppData.resultContent;
                        _this.importXiangmu(ppxiangmuleixing);

                    }else{
                        layer.alert(message);
                    }
                }
            },"json");

        },

        getxinguotanValue : function(ppFileurl,ppxiangmuleixing){
            var _this=this;
            _this.excelxiangmulist=[];
            layer.open({type:3});
            $.post("/import_xiangmu/get_xinguotan",{
                xiangmuid : _this.xiangmuId,
                fileurl:ppFileurl,
                random : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if(ppData != null){
                    var mmData = ppData;
                    var result = mmData.result;
                    var message = mmData.message;
                    var data = mmData.resultContent;
                    if(result == "1") {
                        _this.excelxiangmulist = ppData.resultContent;
                        _this.importXiangmu(ppxiangmuleixing);

                    }else{
                        layer.alert(message);
                    }
                }
            },"json");

        },

        getchuangxinchanpinValue : function(ppFileurl,ppxiangmuleixing){
            var _this=this;
            _this.excelxiangmulist=[];
            layer.open({type:3});
            $.post("/import_xiangmu/get_chuangxinchanpin",{
                xiangmuid : _this.xiangmuId,
                fileurl:ppFileurl,
                random : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if(ppData != null){
                    var mmData = ppData;
                    var result = mmData.result;
                    var message = mmData.message;
                    var data = mmData.resultContent;
                    if(result == "1") {
                        _this.excelxiangmulist = ppData.resultContent;
                        _this.importXiangmu(ppxiangmuleixing);

                    }else{
                        layer.alert(message);
                    }
                }
            },"json");

        },


        importXiangmu : function(ppxiangmuleixing){
            var _this = this;
            layer.confirm("确定要导入所有项目吗？",{
                btn : ["是","否"]
            },function(){
                layer.closeAll("dialog");
                _this.startDaoru(ppxiangmuleixing);
            });
        },

        startDaoru : function(ppxiangmuleixing){
            var _this = this;
            layer.open({type:3});
            /*if(ppxiangmuleixing=="1"){
                _this.daorukangjun(0);
            }
            if(ppxiangmuleixing=="2"){
                _this.daorutongkeyaopin(0);
            }
            if(ppxiangmuleixing=="3"){
                _this.daoruzhuankeyaopin(0);
            }
            if(ppxiangmuleixing=="4"){
                _this.daoruxinguotan(0);
            }
            if(ppxiangmuleixing=="5"){
                _this.daoruchuangxinchanpin(0);
            }
            if(ppxiangmuleixing=="6"){
                _this.daoruxinyao(0);
            }
            if(ppxiangmuleixing=="7"){
                _this.daoruyuecaikangjun(0);
            }
            if(ppxiangmuleixing=="8"){
                _this.daorushengchanqiye(0);
            }*/
            //_this.daorushengchanqiye(0);

        },
        daorushengchanqiye : function(ppMuluCurrentIndex){
            layer.open({type:3});
            var _this=this;
            var  CurrentIndex = ppMuluCurrentIndex+1;
            layer.open({
                type: 3,
                content: "<div style='font-size:18px;font-weight:bold;padding-top:40px;width:200px;text-align:left;'>正在导入项目<br/>当前进度    "+CurrentIndex+" / "+_this.excelxiangmulist.length+"</div>"
            });

            $.post("/import_xiangmu/import_shengchanqiye",{
                xianmguid : _this.xiangmuId,
                pinzhongbianhao:_this.excelxiangmulist[ppMuluCurrentIndex].品种序号,
                beizhu1:_this.excelxiangmulist[ppMuluCurrentIndex].药品分类,
                yaopinpinming:_this.excelxiangmulist[ppMuluCurrentIndex].药品品名,
                jixing:_this.excelxiangmulist[ppMuluCurrentIndex].剂型,
                pinguixuhao:_this.excelxiangmulist[ppMuluCurrentIndex].规格序号,
                yaopinmingcheng:_this.excelxiangmulist[ppMuluCurrentIndex].药品名称,
                guige:_this.excelxiangmulist[ppMuluCurrentIndex].规格,
                danwei:_this.excelxiangmulist[ppMuluCurrentIndex].单位,
                yibaoleibie:_this.excelxiangmulist[ppMuluCurrentIndex].医保类别,
                jianchatongbao:_this.excelxiangmulist[ppMuluCurrentIndex].上级检查通报,
                weiguawang:_this.excelxiangmulist[ppMuluCurrentIndex].未挂网,
                wupeisongqiye:_this.excelxiangmulist[ppMuluCurrentIndex].无配送企业,
                yuanguotan:_this.excelxiangmulist[ppMuluCurrentIndex].原国谈,
                yizhixingpingjia:_this.excelxiangmulist[ppMuluCurrentIndex].通过一致性评价,
                baomipeifang:_this.excelxiangmulist[ppMuluCurrentIndex].国家保密配方,
                baohupinzhong:_this.excelxiangmulist[ppMuluCurrentIndex].中药保护品种,
                jiage:_this.excelxiangmulist[ppMuluCurrentIndex].价格,
                yuanyan:_this.excelxiangmulist[ppMuluCurrentIndex].原研,
                jiyao:_this.excelxiangmulist[ppMuluCurrentIndex].基药,
                jicai:_this.excelxiangmulist[ppMuluCurrentIndex].集采,
                yuanbenbu:_this.excelxiangmulist[ppMuluCurrentIndex].院本部,
                qinhuai:_this.excelxiangmulist[ppMuluCurrentIndex].秦淮,
                chanpinbianma:_this.excelxiangmulist[ppMuluCurrentIndex].产品编码,
                shengchanqiye:_this.excelxiangmulist[ppMuluCurrentIndex].生产企业,
                beizhu:_this.excelxiangmulist[ppMuluCurrentIndex].备注,
                ordernumber:_this.excelxiangmulist[ppMuluCurrentIndex].排序,
                beizhu2:_this.excelxiangmulist[ppMuluCurrentIndex].备注2,
                beizhu3:_this.excelxiangmulist[ppMuluCurrentIndex].备注3,
                beizhu4:_this.excelxiangmulist[ppMuluCurrentIndex].备注4,
                beizhu5:_this.excelxiangmulist[ppMuluCurrentIndex].备注5,
                beizhu6:_this.excelxiangmulist[ppMuluCurrentIndex].备注6,
                random : Math.random()
            }, function(ppData) {
                layer.closeAll("loading");

                if (ppData.result == "0") {
                    layer.alert(ppData.message);
                }else{

                    if(ppMuluCurrentIndex >=_this.excelxiangmulist.length - 1){

                        layer.alert("导入完成！");
                        $("#uploadModal").modal("hide");
                    }else{
                        ppMuluCurrentIndex++;
                        _this.daorushengchanqiye(ppMuluCurrentIndex);
                    }
                }
            },"json")
        },

        daoruxinyao : function(ppMuluCurrentIndex){
            layer.open({type:3});
            var _this=this;
            var  CurrentIndex = ppMuluCurrentIndex+1;
            layer.open({
                type: 3,
                content: "<div style='font-size:18px;font-weight:bold;padding-top:40px;width:200px;text-align:left;'>正在导入项目<br/>当前进度    "+CurrentIndex+" / "+_this.excelxiangmulist.length+"</div>"
            });

            $.post("/import_xiangmu/import_xinyaoshenqing",{
                xiangmuid : _this.xiangmuId,
                yaopinmingcheng:_this.excelxiangmulist[ppMuluCurrentIndex].药品名称,
                guigebaozhuang:_this.excelxiangmulist[ppMuluCurrentIndex].规格包装,
                shenqingkeshi:_this.excelxiangmulist[ppMuluCurrentIndex].申请科室,
                zhuankezubie:_this.excelxiangmulist[ppMuluCurrentIndex].专科组别,
                shifoujiyao:_this.excelxiangmulist[ppMuluCurrentIndex].是否是基药,
                shifouchuangxin:_this.excelxiangmulist[ppMuluCurrentIndex].是否是创新药,
                shifouzhinan:_this.excelxiangmulist[ppMuluCurrentIndex].是否是指南推荐,
                shifoulinchuang:_this.excelxiangmulist[ppMuluCurrentIndex].是否有临床基础,
                lincainianfen:_this.excelxiangmulist[ppMuluCurrentIndex].临采5次以上年份,
                xuhao:_this.excelxiangmulist[ppMuluCurrentIndex].序号,
                random : Math.random()
            }, function(ppData) {
                layer.closeAll("loading");

                if (ppData.result == "0") {
                    layer.alert(ppData.message);
                }else{

                    if(ppMuluCurrentIndex >=_this.excelxiangmulist.length - 1){

                        layer.alert("导入完成！");
                        $("#uploadModal").modal("hide");
                    }else{
                        ppMuluCurrentIndex++;
                        _this.daoruxinyao(ppMuluCurrentIndex);
                    }
                }
            },"json")
        },

        daorukangjun : function(ppMuluCurrentIndex){
            layer.open({type:3});
            var _this=this;
            var  CurrentIndex = ppMuluCurrentIndex+1;
            layer.open({
                type: 3,
                content: "<div style='font-size:18px;font-weight:bold;padding-top:40px;width:200px;text-align:left;'>正在导入项目<br/>当前进度    "+CurrentIndex+" / "+_this.excelxiangmulist.length+"</div>"
            });

            $.post("/import_xiangmu/import_kangjun",{
                xianmguid : _this.xiangmuId,
                pinzhong:_this.excelxiangmulist[ppMuluCurrentIndex].品种,
                pingui:_this.excelxiangmulist[ppMuluCurrentIndex].品规,
                yaopinmingcheng:_this.excelxiangmulist[ppMuluCurrentIndex].药品名称,
                fenlei:_this.excelxiangmulist[ppMuluCurrentIndex].分类,
                xianzhitiaojian:_this.excelxiangmulist[ppMuluCurrentIndex].品种品规限制,
                hebinghang:_this.excelxiangmulist[ppMuluCurrentIndex].合并行,
                xianzhishu:_this.excelxiangmulist[ppMuluCurrentIndex].限制数,
                guizebianhao:_this.excelxiangmulist[ppMuluCurrentIndex].规则编号,
                guizeshuoming:_this.excelxiangmulist[ppMuluCurrentIndex].规则描述,
                guige:_this.excelxiangmulist[ppMuluCurrentIndex].规格,
                danwei:_this.excelxiangmulist[ppMuluCurrentIndex].单位,
                jiage:_this.excelxiangmulist[ppMuluCurrentIndex].价格,
                yibaoleibie:_this.excelxiangmulist[ppMuluCurrentIndex].医保类别,
                guojiajibenyaowu:_this.excelxiangmulist[ppMuluCurrentIndex].国家基本药物,
                jicaiyao:_this.excelxiangmulist[ppMuluCurrentIndex].集采药,
                tongguopingjia:_this.excelxiangmulist[ppMuluCurrentIndex].通过评价,
                zhidaoyuanze:_this.excelxiangmulist[ppMuluCurrentIndex].指导原则,
                dongzong:_this.excelxiangmulist[ppMuluCurrentIndex].院本部药,
                dongzongjilu:_this.excelxiangmulist[ppMuluCurrentIndex].东总记录,
                qinhuaiyao:_this.excelxiangmulist[ppMuluCurrentIndex].秦淮药,
                qinhuaijilu:_this.excelxiangmulist[ppMuluCurrentIndex].秦淮记录,
                pinzhongpaiming:_this.excelxiangmulist[ppMuluCurrentIndex].品种排名,
                pinguipiaoshu:_this.excelxiangmulist[ppMuluCurrentIndex].品规得票,
                zhidaoyijian:_this.excelxiangmulist[ppMuluCurrentIndex].指导意见,
                beizhu:_this.excelxiangmulist[ppMuluCurrentIndex].备注,
                beizhu2:_this.excelxiangmulist[ppMuluCurrentIndex].子规则限制数,
                beizhu3:_this.excelxiangmulist[ppMuluCurrentIndex].子规则编号,
                random : Math.random()
            }, function(ppData) {
                layer.closeAll("loading");

                if (ppData.result == "0") {
                    layer.alert(ppData.message);
                }else{

                    if(ppMuluCurrentIndex >=_this.excelxiangmulist.length - 1){

                        layer.alert("导入完成！");
                        $("#uploadModal").modal("hide");
                    }else{
                        ppMuluCurrentIndex++;
                        _this.daorukangjun(ppMuluCurrentIndex);
                    }
                }
            },"json")
        },
        daorutongkeyaopin : function(ppMuluCurrentIndex){
            layer.open({type:3});
            var _this=this;
            var  CurrentIndex = ppMuluCurrentIndex+1;
            layer.open({
                type: 3,
                content: "<div style='font-size:18px;font-weight:bold;padding-top:40px;width:200px;text-align:left;'>正在导入项目<br/>当前进度    "+CurrentIndex+" / "+_this.excelxiangmulist.length+"</div>"
            });

            $.post("/import_xiangmu/import_tongkeyaopin",{
                xianmguid : _this.xiangmuId,
                xuhao:_this.excelxiangmulist[ppMuluCurrentIndex].序号,
                yaopinmingcheng:_this.excelxiangmulist[ppMuluCurrentIndex].药品名称,
                guige:_this.excelxiangmulist[ppMuluCurrentIndex].规格,
                shengchanchangjia:_this.excelxiangmulist[ppMuluCurrentIndex].生产厂家,
                danwei:_this.excelxiangmulist[ppMuluCurrentIndex].单位,
                jiage:_this.excelxiangmulist[ppMuluCurrentIndex].价格,
                yibaoleibie:_this.excelxiangmulist[ppMuluCurrentIndex].医保类别,
                guojiajibenyaowu:_this.excelxiangmulist[ppMuluCurrentIndex].基药,
                jicaiyao:_this.excelxiangmulist[ppMuluCurrentIndex].集采药,
                tongguopingjia:_this.excelxiangmulist[ppMuluCurrentIndex].通过评价,
                baomipeifang:_this.excelxiangmulist[ppMuluCurrentIndex].中药保密配方,
                zhongyaobaohu:_this.excelxiangmulist[ppMuluCurrentIndex].国家中药保护,
                yuanguotanyao:_this.excelxiangmulist[ppMuluCurrentIndex].原国谈药,
                chuanxinyao:_this.excelxiangmulist[ppMuluCurrentIndex].创新药,
                jiankongyao:_this.excelxiangmulist[ppMuluCurrentIndex].重点监控药,
                zhusheji:_this.excelxiangmulist[ppMuluCurrentIndex].中药注射剂,
                buliangfanying:_this.excelxiangmulist[ppMuluCurrentIndex].严重不良反应,
                diaowangyao:_this.excelxiangmulist[ppMuluCurrentIndex].掉网药,
                dongzong:_this.excelxiangmulist[ppMuluCurrentIndex].院本部药,
                dongzongjilu:_this.excelxiangmulist[ppMuluCurrentIndex].东总记录,
                qinhuaiyao:_this.excelxiangmulist[ppMuluCurrentIndex].秦淮药,
                qinhuaijilu:_this.excelxiangmulist[ppMuluCurrentIndex].秦淮记录,
                zhuankefenzu:_this.excelxiangmulist[ppMuluCurrentIndex].专科分组,
                yuxuanyijian:_this.excelxiangmulist[ppMuluCurrentIndex].专科组预选意见,
                beizhu:_this.excelxiangmulist[ppMuluCurrentIndex].备注,
                xianzhishu:_this.excelxiangmulist[ppMuluCurrentIndex].限制数,
                guizebianhao:_this.excelxiangmulist[ppMuluCurrentIndex].规则编号,
                guizeshuoming:_this.excelxiangmulist[ppMuluCurrentIndex].规则描述,
                taotai:_this.excelxiangmulist[ppMuluCurrentIndex].淘汰,
                random : Math.random()
            }, function(ppData) {
                layer.closeAll("loading");

                if (ppData.result == "0") {
                    layer.alert(ppData.message);
                }else{

                    if(ppMuluCurrentIndex >=_this.excelxiangmulist.length - 1){

                        layer.alert("导入完成！");
                        $("#uploadModal").modal("hide");
                    }else{
                        ppMuluCurrentIndex++;
                        _this.daorutongkeyaopin(ppMuluCurrentIndex);
                    }
                }
            },"json")
        },

        daoruzhuankeyaopin : function(ppMuluCurrentIndex){
            layer.open({type:3});
            var _this=this;
            var  CurrentIndex = ppMuluCurrentIndex+1;
            layer.open({
                type: 3,
                content: "<div style='font-size:18px;font-weight:bold;padding-top:40px;width:200px;text-align:left;'>正在导入项目<br/>当前进度    "+CurrentIndex+" / "+_this.excelxiangmulist.length+"</div>"
            });

            $.post("/import_xiangmu/import_zhuankeyaopin",{
                xianmguid : _this.xiangmuId,
                xuhao:_this.excelxiangmulist[ppMuluCurrentIndex].序号,
                yaopinmingcheng:_this.excelxiangmulist[ppMuluCurrentIndex].药品名称,
                guige:_this.excelxiangmulist[ppMuluCurrentIndex].规格,
                shengchanchangjia:_this.excelxiangmulist[ppMuluCurrentIndex].生产厂家,
                danwei:_this.excelxiangmulist[ppMuluCurrentIndex].单位,
                jiage:_this.excelxiangmulist[ppMuluCurrentIndex].价格,
                yibaoleibie:_this.excelxiangmulist[ppMuluCurrentIndex].医保类别,
                guojiajibenyaowu:_this.excelxiangmulist[ppMuluCurrentIndex].基药,
                jicaiyao:_this.excelxiangmulist[ppMuluCurrentIndex].集采药,
                tongguopingjia:_this.excelxiangmulist[ppMuluCurrentIndex].通过评价,
                baomipeifang:_this.excelxiangmulist[ppMuluCurrentIndex].中药保密配方,
                zhongyaobaohu:_this.excelxiangmulist[ppMuluCurrentIndex].国家中药保护,
                yuanguotanyao:_this.excelxiangmulist[ppMuluCurrentIndex].原国谈药,
                chuanxinyao:_this.excelxiangmulist[ppMuluCurrentIndex].创新药,
                jiankongyao:_this.excelxiangmulist[ppMuluCurrentIndex].重点监控药,
                zhusheji:_this.excelxiangmulist[ppMuluCurrentIndex].中药注射剂,
                buliangfanying:_this.excelxiangmulist[ppMuluCurrentIndex].严重不良反应,
                diaowangyao:_this.excelxiangmulist[ppMuluCurrentIndex].掉网药,
                dongzong:_this.excelxiangmulist[ppMuluCurrentIndex].院本部药,
                dongzongjilu:_this.excelxiangmulist[ppMuluCurrentIndex].东总记录,
                qinhuaiyao:_this.excelxiangmulist[ppMuluCurrentIndex].秦淮药,
                qinhuaijilu:_this.excelxiangmulist[ppMuluCurrentIndex].秦淮记录,
                zhuankefenzu:_this.excelxiangmulist[ppMuluCurrentIndex].专科分组,
                yuxuanyijian:_this.excelxiangmulist[ppMuluCurrentIndex].专科组预选意见,
                beizhu:_this.excelxiangmulist[ppMuluCurrentIndex].备注,
                xianzhishu:_this.excelxiangmulist[ppMuluCurrentIndex].限制数,
                guizebianhao:_this.excelxiangmulist[ppMuluCurrentIndex].规则编号,
                guizeshuoming:_this.excelxiangmulist[ppMuluCurrentIndex].规则描述,
                taotai:_this.excelxiangmulist[ppMuluCurrentIndex].必淘汰,
                beizhu2:_this.excelxiangmulist[ppMuluCurrentIndex].预选会意见,
                random : Math.random()
            }, function(ppData) {
                layer.closeAll("loading");

                if (ppData.result == "0") {
                    layer.alert(ppData.message);
                }else{

                    if(ppMuluCurrentIndex >=_this.excelxiangmulist.length - 1){

                        layer.alert("导入完成！");
                        $("#uploadModal").modal("hide");
                    }else{
                        ppMuluCurrentIndex++;
                        _this.daoruzhuankeyaopin(ppMuluCurrentIndex);
                    }
                }
            },"json")
        },

        daoruyuecaikangjun : function(ppMuluCurrentIndex){
            layer.open({type:3});
            var _this=this;
            var  CurrentIndex = ppMuluCurrentIndex+1;
            layer.open({
                type: 3,
                content: "<div style='font-size:18px;font-weight:bold;padding-top:40px;width:200px;text-align:left;'>正在导入项目<br/>当前进度    "+CurrentIndex+" / "+_this.excelxiangmulist.length+"</div>"
            });

            $.post("/import_xiangmu/import_yuecaikangjun",{
                xiangmuid : _this.xiangmuId,
                yaopinmingcheng:_this.excelxiangmulist[ppMuluCurrentIndex].药品名称,
                yibao:_this.excelxiangmulist[ppMuluCurrentIndex].医保,
                yuanbenbuyao:_this.excelxiangmulist[ppMuluCurrentIndex].院本部药,
                qinhuaiyao:_this.excelxiangmulist[ppMuluCurrentIndex].秦淮药,
                nanjingchuangxin:_this.excelxiangmulist[ppMuluCurrentIndex].药品类别,
               /* zhuankefenzu:_this.excelxiangmulist[ppMuluCurrentIndex].专科分组,
                shenqingkeshi:_this.excelxiangmulist[ppMuluCurrentIndex].申请科室,*/
                beizhu4:_this.excelxiangmulist[ppMuluCurrentIndex].备注4,
                beizhu:_this.excelxiangmulist[ppMuluCurrentIndex].备注,
                beizhu2:_this.excelxiangmulist[ppMuluCurrentIndex].备注2,
                beizhu3:_this.excelxiangmulist[ppMuluCurrentIndex].备注3,
                xuhao:_this.excelxiangmulist[ppMuluCurrentIndex].序号,
                random : Math.random()
            }, function(ppData) {
                layer.closeAll("loading");

                if (ppData.result == "0") {
                    layer.alert(ppData.message);
                }else{

                    if(ppMuluCurrentIndex >=_this.excelxiangmulist.length - 1){

                        layer.alert("导入完成！");
                        $("#uploadModal").modal("hide");
                    }else{
                        ppMuluCurrentIndex++;
                        _this.daoruyuecaikangjun(ppMuluCurrentIndex);
                    }
                }
            },"json")
        },

        daoruxinguotan : function(ppMuluCurrentIndex){
            layer.open({type:3});
            var _this=this;
            var  CurrentIndex = ppMuluCurrentIndex+1;
            layer.open({
                type: 3,
                content: "<div style='font-size:18px;font-weight:bold;padding-top:40px;width:200px;text-align:left;'>正在导入项目<br/>当前进度    "+CurrentIndex+" / "+_this.excelxiangmulist.length+"</div>"
            });

            $.post("/import_xiangmu/import_xinguotan",{
                xiangmuid : _this.xiangmuId,
                yaopinmingcheng:_this.excelxiangmulist[ppMuluCurrentIndex].药品名称,
                yibao:_this.excelxiangmulist[ppMuluCurrentIndex].医保,
                /*guize:_this.excelxiangmulist[ppMuluCurrentIndex].规则,*/
                yuanbenbuyao:_this.excelxiangmulist[ppMuluCurrentIndex].院本部药,
                qinhuaiyao:_this.excelxiangmulist[ppMuluCurrentIndex].秦淮药,
                zhuankefenzu:_this.excelxiangmulist[ppMuluCurrentIndex].专科分组,
                shenqingkeshi:_this.excelxiangmulist[ppMuluCurrentIndex].申请科室,
                beizhu:_this.excelxiangmulist[ppMuluCurrentIndex].备注,
                beizhu2:_this.excelxiangmulist[ppMuluCurrentIndex].备注2,
                beizhu3:_this.excelxiangmulist[ppMuluCurrentIndex].备注3,
                xuhao:_this.excelxiangmulist[ppMuluCurrentIndex].序号,
                random : Math.random()
            }, function(ppData) {
                layer.closeAll("loading");

                if (ppData.result == "0") {
                    layer.alert(ppData.message);
                }else{

                    if(ppMuluCurrentIndex >=_this.excelxiangmulist.length - 1){

                        layer.alert("导入完成！");
                        $("#uploadModal").modal("hide");
                    }else{
                        ppMuluCurrentIndex++;
                        _this.daoruxinguotan(ppMuluCurrentIndex);
                    }
                }
            },"json")
        },

        daoruchuangxinchanpin : function(ppMuluCurrentIndex){
            layer.open({type:3});
            var _this=this;
            var  CurrentIndex = ppMuluCurrentIndex+1;
            layer.open({
                type: 3,
                content: "<div style='font-size:18px;font-weight:bold;padding-top:40px;width:200px;text-align:left;'>正在导入项目<br/>当前进度    "+CurrentIndex+" / "+_this.excelxiangmulist.length+"</div>"
            });

            $.post("/import_xiangmu/import_chuangxinchanpin",{
                xiangmuid : _this.xiangmuId,
                yaopinmingcheng:_this.excelxiangmulist[ppMuluCurrentIndex].药品名称,
                guige:_this.excelxiangmulist[ppMuluCurrentIndex].规格,
                danwei:_this.excelxiangmulist[ppMuluCurrentIndex].价格,
                jiage:_this.excelxiangmulist[ppMuluCurrentIndex].价格,
                shengchanchangjia:_this.excelxiangmulist[ppMuluCurrentIndex].生产厂家,
                zhixingshijian:_this.excelxiangmulist[ppMuluCurrentIndex].执行时间,
                yuanbenbu:_this.excelxiangmulist[ppMuluCurrentIndex].院本部,
                qinhuai:_this.excelxiangmulist[ppMuluCurrentIndex].秦淮,
                xuhao:_this.excelxiangmulist[ppMuluCurrentIndex].序号,
                random : Math.random()
            }, function(ppData) {
                layer.closeAll("loading");

                if (ppData.result == "0") {
                    layer.alert(ppData.message);
                }else{

                    if(ppMuluCurrentIndex >=_this.excelxiangmulist.length - 1){

                        layer.alert("导入完成！");
                        $("#uploadModal").modal("hide");
                    }else{
                        ppMuluCurrentIndex++;
                        _this.daoruchuangxinchanpin(ppMuluCurrentIndex);
                    }
                }
            },"json")
        },





        //检查数字
        checknum : function(ppNum) {
            var regPos = /^\d+(\.\d+)?$/; //非负浮点数
            var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数

            if (regPos.test(ppNum) || regNeg.test(ppNum)) {
                return true;
            } else {
                return false;
            }
        },

        //检查输入信息
        checkInputData : function() {
            var _this = this;

            var xiangmuname = !_this.xiangmu.xiangmuname ? "" : $.trim(_this.xiangmu.xiangmuname);
            if("" == xiangmuname){
                layer.alert("请填写项目名称！");
                return false;
            }

            var xiangmuleixing = !_this.xiangmu.xiangmuleixing ? "" : $.trim(_this.xiangmu.xiangmuleixing);
            if("" == xiangmuleixing){
                layer.alert("请选择项目类型！");
                return false;
            }

           /* var meetingtime = !_this.xiangmu.meetingtime ? "" : $.trim(_this.xiangmu.meetingtime);
            if("" == meetingtime){
                layer.alert("请选择会议时间！");
                return false;
            }*/


            var zhuangjiashu = !_this.xiangmu.zhuangjiashu ? "" : $.trim(_this.xiangmu.zhuangjiashu);
            if("" == zhuangjiashu){
                layer.alert("请填写评委人数！");
                return false;
            }
            if (!_this.checknum(zhuangjiashu)) {
                layer.alert("评委人数请填写数字格式！");
                return false;
            }

          /*  var tongguoshu = !_this.xiangmu.tongguoshu ? "" : $.trim(_this.xiangmu.tongguoshu);
            if("" == tongguoshu){
                layer.alert("请填写通过人数！");
                return false;
            }
            if (!_this.checknum(tongguoshu)) {
                layer.alert("通过人数请填写数字格式！");
                return false;
            }*/

            return true;

        },


        //跳到首页
        SetPageIndex : function(){
            this.pageIndex = 1;
        },
        SetPageEnd : function(){
            this.pageIndex = this.pageCount;
        },
        //上一页
        SetPageIndexPrePage : function(){
            var PrePage = ((this.pageIndex -1) <= 0) ? 1 : (this.pageIndex -1);
            this.pageIndex = PrePage;
        },
        //下一页
        SetPageIndexNextPage : function(){
            var NextPage = ((this.pageIndex +1) >= this.pageCount) ? this.pageCount : (this.pageIndex +1);
            this.pageIndex = NextPage;
        },
        //跳转界面
        JumpPage : function(){
            if(this.inputPageIndexValue <= 1){
                this.inputPageIndexValue = 1;
            }else if(this.inputPageIndexValue >= this.pageCount){
                this.inputPageIndexValue = this.pageCount;
            }
            this.pageIndex = this.inputPageIndexValue;
            this.inputPageIndexValue = '';
        },
    },
    watch :{
        //监控分页情况，刷新列表
        pageIndex : function(){
            this.bindXiangmuList();
            window.sessionStorage.setItem('currentPageNum', this.pageIndex);
        }
    }




});